package com.applcn.shop.controller.merchant;

import com.applcn.core.base.Result;
import com.applcn.shop.service.CategoryService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * com.applcn.shop.controller.merchant
 * Description:
 *
 * @author: 大妖怪
 * @date: 2020-03-26 00:15
 */
@RestController
@RequestMapping("/api/shop/category")
@RequiredArgsConstructor
public class CategoryController {

    private final CategoryService categoryService;

    /**
     * 查询类目列表
     *
     * @param parentId
     * @return
     */
    @GetMapping("/categoryList")
    public Result categoryList(@RequestParam("parentId") Long parentId) {
        return categoryService.categoryList(parentId);
    }
}
